package com.hello.sky.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hello.sky.annotation.AutoFill;
import com.hello.sky.enmu.OperationType;
import com.hello.sky.model.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 菜品口味关系表 Mapper 接口
 * </p>
 *
 * @author D
 */
@Mapper
public interface DishFlavorMapper extends BaseMapper<DishFlavor> {

    @AutoFill(OperationType.INSERT)
    void addFlavor(@Param("flavors") List<DishFlavor> flavors, @Param("dishId") Long dishId);

    void delByDishIds(@Param("ids") List<Long> ids);

    List<DishFlavor> getFlavorByDishId(@Param("id") Long id);

    void deleteByDishId(@Param("id") Long id);

    @AutoFill(OperationType.INSERT)
    void addFlavorBatch(@Param("flavors") List<DishFlavor> flavors);
}
